Optimal. Leaf size=46 \[ -\frac {a^2 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {2 i \cos (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3496, 3770} \[ -\frac {a^2 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {2 i \cos (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3496
Rule 3770
Rubi steps
\begin {align*} \int \cos (c+d x) (a+i a \tan (c+d x))^2 \, dx &=-\frac {2 i \cos (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{d}-a^2 \int \sec (c+d x) \, dx\\ &=-\frac {a^2 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {2 i \cos (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.27, size = 180, normalized size = 3.91 \[ \frac {a^2 \left (\cos \left (\frac {1}{2} (c+5 d x)\right )+i \sin \left (\frac {1}{2} (c+5 d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )-2 i\right )+\sin \left (\frac {1}{2} (c+d x)\right ) \left (-i \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+i \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+2\right )\right )}{d (\cos (d x)+i \sin (d x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.53, size = 52, normalized size = 1.13 \[ \frac {-2 i \, a^{2} e^{\left (i \, d x + i \, c\right )} - a^{2} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) + a^{2} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.19, size = 56, normalized size = 1.22 \[ \frac {-2 i \, a^{2} e^{\left (i \, d x + i \, c\right )} - a^{2} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) + a^{2} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.30, size = 53, normalized size = 1.15 \[ -\frac {2 i a^{2} \cos \left (d x +c \right )}{d}+\frac {2 a^{2} \sin \left (d x +c \right )}{d}-\frac {a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.37, size = 61, normalized size = 1.33 \[ -\frac {a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} + 4 i \, a^{2} \cos \left (d x + c\right ) - 2 \, a^{2} \sin \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.37, size = 41, normalized size = 0.89 \[ -\frac {2\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {4\,a^2}{d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.29, size = 68, normalized size = 1.48 \[ \frac {a^{2} \left (\log {\left (e^{i d x} - i e^{- i c} \right )} - \log {\left (e^{i d x} + i e^{- i c} \right )}\right )}{d} + \begin {cases} - \frac {2 i a^{2} e^{i c} e^{i d x}}{d} & \text {for}\: d \neq 0 \\2 a^{2} x e^{i c} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________